<template>
  <div class="home-container">
    <div class="welcome-section">
      <h1>Welcome To InnoClub</h1>
      <p class="slogan">AI驱动学习，系统化训练，社区化交流，让技术提升更高效</p>
    </div>

    <div class="features-grid">
      <!-- AI面试模块 -->
      <div class="feature-card" @click="$router.push('/ai')">
        <div class="card-icon ai">
          <a-icon type="robot" />
        </div>
        <div class="card-content">
          <h3>AI 模拟面试</h3>
          <p>智能面试官一对一陪练，提供专业面试指导</p>
          <div class="card-tags">
            <a-tag class="tag-ai-1">自我介绍</a-tag>
            <a-tag class="tag-ai-2">技术面试</a-tag>
            <a-tag class="tag-ai-3">薪资谈判</a-tag>
          </div>
        </div>
      </div>

      <!-- 练题模块 -->
      <div class="feature-card" @click="$router.push('/practice')">
        <div class="card-icon practice">
          <a-icon type="code" />
        </div>
        <div class="card-content">
          <h3>面试练题</h3>
          <p>海量面试真题，实时查看答案和解析</p>
          <div class="card-tags">
            <a-tag class="tag-practice-1">基础知识</a-tag>
            <a-tag class="tag-practice-2">实战案例</a-tag>
            <a-tag class="tag-practice-3">即时反馈</a-tag>
          </div>
        </div>
      </div>

      <!-- 刷题模块 -->
      <div class="feature-card" @click="$router.push('/problems')">
        <div class="card-icon problems">
          <a-icon type="book" />
        </div>
        <div class="card-content">
          <h3>刷题训练</h3>
          <p>系统化的题目分类，助你全面提升</p>
          <div class="card-tags">
            <a-tag class="tag-problems-1">分类练习</a-tag>
            <a-tag class="tag-problems-2">难度递进</a-tag>
            <a-tag class="tag-problems-3">详细解析</a-tag>
          </div>
        </div>
      </div>

      <!-- 交流群模块 -->
      <div class="feature-card" @click="$router.push('/group')">
        <div class="card-icon group">
          <a-icon type="team" />
        </div>
        <div class="card-content">
          <h3>交流群</h3>
          <p>加入技术交流群，与伙伴共同进步</p>
          <div class="card-tags">
            <a-tag class="tag-group-1">技术交流</a-tag>
            <a-tag class="tag-group-2">经验分享</a-tag>
            <a-tag class="tag-group-3">资源互助</a-tag>
          </div>
        </div>
      </div>

      <!-- 动态圈模块 -->
      <div class="feature-card" @click="$router.push('/social')">
        <div class="card-icon social">
          <a-icon type="interaction" />
        </div>
        <div class="card-content">
          <h3>动态圈</h3>
          <p>分享学习心得，结识志同道合的朋友</p>
          <div class="card-tags">
            <a-tag class="tag-social-1">学习分享</a-tag>
            <a-tag class="tag-social-2">求职交流</a-tag>
            <a-tag class="tag-social-3">社区互动</a-tag>
          </div>
        </div>
      </div>

      <!-- 意见反馈模块 -->
      <div class="feature-card" @click="handleFeedback">
        <div class="card-icon feedback">
          <a-icon type="message" />
        </div>
        <div class="card-content">
          <h3>意见反馈</h3>
          <p>帮助我们变得更好，您的建议是我们进步的动力</p>
          <div class="card-tags">
            <a-tag class="tag-feedback-1">问题反馈</a-tag>
            <a-tag class="tag-feedback-2">功能建议</a-tag>
            <a-tag class="tag-feedback-3">体验优化</a-tag>
          </div>
        </div>
      </div>
    </div>
  </div>
</template>

<script>
export default {
  name: 'Home',
  methods: {
    handleFeedback() {
      this.$router.push('/feedback')
    }
  }
}
</script>

<style scoped>
.home-container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 40px 20px;
}

.welcome-section {
  text-align: center;
  margin-bottom: 60px;
}

.welcome-section h1 {
  font-size: 36px;
  color: #1f2937;
  margin-bottom: 16px;
}

.slogan {
  font-size: 18px;
  color: #6b7280;
}

.features-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 24px;
}

.feature-card {
  background: white;
  border-radius: 12px;
  padding: 24px;
  display: flex;
  align-items: flex-start;
  gap: 20px;
  cursor: pointer;
  transition: all 0.3s ease;
  border: 1px solid #e5e7eb;
}

.feature-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 12px 24px rgba(0, 0, 0, 0.05);
}

.card-icon {
  width: 48px;
  height: 48px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.card-icon :deep(svg) {
  font-size: 24px;
  color: white;
}

/* 不同模块的图标背景色 */
.ai {
  background: linear-gradient(135deg, #6366f1, #4f46e5);
}

.practice {
  background: linear-gradient(135deg, #3b82f6, #2563eb);
}

.problems {
  background: linear-gradient(135deg, #10b981, #059669);
}

.group {
  background: linear-gradient(135deg, #f59e0b, #d97706);
}

.social {
  background: linear-gradient(135deg, #ec4899, #db2777);
}

.feedback {
  background: linear-gradient(135deg, #36cfc9, #13c2c2);
}

.card-content {
  flex: 1;
}

.card-content h3 {
  font-size: 18px;
  color: #1f2937;
  margin-bottom: 8px;
}

.card-content p {
  font-size: 14px;
  color: #6b7280;
  margin-bottom: 16px;
  line-height: 1.5;
}

.card-tags {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

:deep(.ant-tag) {
  margin: 0;
  border-radius: 4px;
  padding: 2px 8px;
  font-size: 12px;
}

/* 响应式调整 */
@media (max-width: 768px) {
  .features-grid {
    grid-template-columns: 1fr;
  }

  .welcome-section h1 {
    font-size: 28px;
  }

  .slogan {
    font-size: 16px;
  }
}

/* AI模块标签样式 */
:deep(.tag-ai-1) {
  color: #6366f1;
  background: #eef2ff;
}
:deep(.tag-ai-2) {
  color: #4f46e5;
  background: #e0e7ff;
}
:deep(.tag-ai-3) {
  color: #4338ca;
  background: #ddd6fe;
}

/* 练题模块标签样式 */
:deep(.tag-practice-1) {
  color: #3b82f6;
  background: #eff6ff;
}
:deep(.tag-practice-2) {
  color: #2563eb;
  background: #dbeafe;
}
:deep(.tag-practice-3) {
  color: #1d4ed8;
  background: #bfdbfe;
}

/* 刷题模块标签样式 */
:deep(.tag-problems-1) {
  color: #10b981;
  background: #ecfdf5;
}
:deep(.tag-problems-2) {
  color: #059669;
  background: #d1fae5;
}
:deep(.tag-problems-3) {
  color: #047857;
  background: #a7f3d0;
}

/* 交流群模块标签样式 */
:deep(.tag-group-1) {
  color: #f59e0b;
  background: #fef3c7;
}
:deep(.tag-group-2) {
  color: #d97706;
  background: #fde68a;
}
:deep(.tag-group-3) {
  color: #b45309;
  background: #fcd34d;
}

/* 动态圈模块标签样式 */
:deep(.tag-social-1) {
  color: #ec4899;
  background: #fce7f3;
}
:deep(.tag-social-2) {
  color: #db2777;
  background: #fbcfe8;
}
:deep(.tag-social-3) {
  color: #be185d;
  background: #f9a8d4;
}

/* 意见反馈标签样式 */
:deep(.tag-feedback-1) {
  color: #13c2c2;
  background: #e6fffb;
  border: none;
}
:deep(.tag-feedback-2) {
  color: #08979c;
  background: #b5f5ec;
  border: none;
}
:deep(.tag-feedback-3) {
  color: #006d75;
  background: #87e8de;
  border: none;
}

/* 标签hover效果 */
:deep(.ant-tag) {
  transition: all 0.3s ease;
}

:deep(.ant-tag:hover) {
  transform: scale(1.05);
}

:deep(.tag-feedback-1:hover),
:deep(.tag-feedback-2:hover),
:deep(.tag-feedback-3:hover) {
  transform: scale(1.05);
}
</style> 